<!--#include file="common/header.html"-->
<body>
    <div class="container-fluid larry-wrapper">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12">
                <!--头部搜索-->
                <section class="panel panel-padding">
                    <form class="layui-form" action="/education/admin/rebate">
                        <div class="layui-form">
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input class="layui-input" name="_query.keyword" placeholder="关键字">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button lay-submit class="layui-btn" lay-filter="search">查找</button>
                            </div>
                        </div>
                    </form>
                </section>

                <!--列表-->
                <section class="panel panel-padding">
                    <div class="group-button">
                        <button class="layui-btn layui-btn-small modal-catch" beforeFun="beforeAdd"
                                data-params='{"content":".add-subcat", "title":"添加","type":"1", "area":"500,400", "maxmin":"true"}'>
                            <i class="iconfont">&#xe649;</i> 添加
                        </button>
                        <!--<button class="layui-btn layui-btn-small" onclick="viewDetail();">
                            <i class="iconfont">&#xe653;</i>编辑
                        </button>-->
                        <button class="layui-btn layui-btn-small layui-btn-danger ajax-all" data-name="checkbox" data-params='{"url": "/education/admin/rebate/delete"}'>
                            <i class="iconfont">&#xe626;</i> 删除
                        </button>
                    </div>
                    <div id="list" class="layui-form"></div>

                    <div class="text-right" id="page"></div>
                </section>
            </div>
        </div>
    </div>
    <div class="add-subcat">
        <form class="layui-form layui-form-pane" action="/education/admin/rebate/save" id="form1">
            <input type="hidden" name="id">

            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-right: 0px;padding-left: 0px;">方案名</label>
                <div class="layui-input-inline">
                    <input type="text" name="a.name" required placeholder=""
                           jq-verify="required" class="layui-input ">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-right: 0px;padding-left: 0px;">一级用户返利</label>
                <div class="layui-input-inline">
                    <input type="number" name="a.normal_rate1" required placeholder="上级用户返利百分比"
                           jq-verify="required" class="layui-input ">
                </div>
                <div class="layui-form-mid layui-word-aux">%</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-right: 0px;padding-left: 0px;">一级会员返利</label>
                <div class="layui-input-inline">
                    <input type="number" name="a.vip_rate1" required placeholder="上级会员返利百分比"
                           jq-verify="required" class="layui-input ">
                </div>
                <div class="layui-form-mid layui-word-aux">%</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-right: 0px;padding-left: 0px;">二级用户返利</label>
                <div class="layui-input-inline">
                    <input type="number" name="a.normal_rate2" required placeholder="上上级用户返利比"
                           jq-verify="required" class="layui-input ">
                </div>
                <div class="layui-form-mid layui-word-aux">%</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-right: 0px;padding-left: 0px;">二级会员返利</label>
                <div class="layui-input-inline">
                    <input type="number" name="a.vip_rate2" required placeholder="上上级会员返利比"
                           jq-verify="required" class="layui-input ">
                </div>
                <div class="layui-form-mid layui-word-aux">%</div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" jq-submit jq-filter="submit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>


</body>
<!--#include file="rebate-list.html"-->
<script src="../js/layui/layui.js"></script>
<script type="text/javascript" src="../js/lib/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="../js/lib/rest.js"></script>
<script type="text/javascript" src="../../jsfile/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="../../jsfile/ueditor/ueditor.all.min.js"></script>
<!--#include file="common/version.html"-->
<script>
    layui.use('user_list');

    function beforeAdd(obj){
        $('#form1').attr('action', '/education/admin/rebate/save');
    }

    function viewDetail(ids){
       /* var checked = $("input[name=checkbox]:checked");
        if(checked.length != 1){
            layer.msg('请选择一项待修改的数据');
            return;
        }
        var ids = checked.val();*/
        var index = layer.open({
            type: 1,
            title:'编辑',
            content: $('.add-subcat')
        });
        $('#form1').attr('action', '/education/admin/rebate/update/' + ids);
        restGet('/education/admin/rebate/view/' + ids, null, $('#form1'), function(rs){
        })
    }
</script>

</html>